Skip to content

Persist Danal ready payment data to Supabase payments table#62

Open
WithM2 wants to merge 1 commit intomainfrom
codex/update-schema-for-payment-storage
Open

Persist Danal ready payment data to Supabase payments table#62
WithM2 wants to merge 1 commit intomainfrom
codex/update-schema-for-payment-storage

Conversation

@WithM2
Copy link
Copy Markdown
Owner

@WithM2 WithM2 commented Dec 23, 2025

Motivation

  • Persist Danal ready (initial-auth) responses and request metadata so the system can track pending subscriptions and debug payment flows.
  • Add a dedicated payments table in the Supabase schema to store per-order metadata and Danal start URL/params.
  • Keep runtime types in sync with the DB schema so the Supabase client has typed access to the new table.

Description

  • Added public.payments table and indexes in supabase/schema.sql with columns for order_id, plan_id, amount, user fields, danal_start_url, danal_start_params, and created_at.
  • Extended the TypeScript Database type in src/lib/supabase.ts by adding PaymentRow and a payments table entry so createServiceRoleClient() is fully typed.
  • Updated the Danal ready API at src/app/api/payments/danal/ready/route.ts to call createServiceRoleClient() and insert a new row into the payments table after receiving the readyResponse.
  • The insertion stores nullable fields (user_email, bypass_value) safely and returns a 500 JSON error when Supabase insertion fails.

Testing

  • Ran npm run lint which completed successfully.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
iakkaweb Ready Ready Preview, Comment Dec 23, 2025 3:59am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant